package Datastruct.Clue;

public class TestNode {
    public static void main(String[] args) {

        HeroNode root = new HeroNode(1, "EZ");
        HeroNode root2 = new HeroNode(3, "LKS");
        HeroNode root3 = new HeroNode(6, "JKS");
        HeroNode root4 = new HeroNode(8, "ANNI");
        HeroNode root5 = new HeroNode(10, "MGN");
        HeroNode root6 = new HeroNode(14, "SAINA");

        root.setLeft(root2);
        root.setRiight(root3);
        root2.setLeft(root4);
        root2.setRiight(root5);
        root3.setLeft(root6);

        ClueBinaryTree clueBinaryTree = new ClueBinaryTree();
        clueBinaryTree.setRoot(root);

        //把普通二叉树线索化为线索二叉树
        clueBinaryTree.cluNode();

        //获取10的前驱和后继
        HeroNode left = root5.getLeft();
        HeroNode right = root5.getRiight();
        System.out.println("10号结点的前驱是：" + left.getNo() + "    后继是：" + right.getNo());


        //中序排序线索化二叉树的结果输出
        clueBinaryTree.clueLIst();


    }
}
